package com.citydo.webrtcspringboot.websocket.stream;

import javax.websocket.Session;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

public class ConnectStateTwitch extends ConnectState{
    private long time = 0L;
    public static final int timeError = 15;
    private List<String> mateConnectionId = new ArrayList<>();
    public ConnectStateTwitch(){
        super(null,null,null,false);
    }
    public ConnectStateTwitch(String connectionId, Session session, String identity, Boolean isConnected){
        super(connectionId,session,identity,isConnected);
    }
    public ConnectStateTwitch(String connectionId,Session session,String identity){
        super(connectionId,session,identity);
    }
    public ConnectStateTwitch(ConnectState connectState){
        super(connectState.getConnectionId(),connectState.getSession(),
                connectState.getIdentity(),connectState.getConnectionState(),
                connectState.getUserGrade());
    }
    public void setMateConnectionId(List<String> mateConnectionId){
        this.mateConnectionId = mateConnectionId;
    }
    public List<String> getMateConnectionId(){
        return mateConnectionId;
    }

    public long getTime() {
        return time;
    }

    public static long transTime(){
        long date = System.currentTimeMillis();
        return Long.parseLong(new SimpleDateFormat("yyyyMMddHHmmss").format(date));
    }

    public void setTime(long time) {
        this.time = time;
    }
}
